import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import About from '../views/About'
import Layout from '@/layout'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Layout,
    redirect:'/home',
    children:[{
      path: '/home',
      name: 'Home',
      component: Home,
      meta:{title:'首页',icon:'el-icon-user-solid'}
    }]
  },
  {
    path: '/setting',
    name: 'About',
    component: Layout,
    redirect:'/setting/about',
    children:[{
      path: '/setting/about',
      name: 'About',
      component: About,
      meta:{title:'学员管理',icon:'el-icon-user-solid'}
    }]
  }
]

const router = new VueRouter({
  mode:"history",
  routes
})

export default router
